﻿@model List<DoKnow.CloudEdu.CMS.Host.Models.MenuItemModel>
@{
    Layout = null;
}
<div class="page-sidebar-wrapper">
    <div class="page-sidebar navbar-collapse collapse">
        <!-- BEGIN SIDEBAR MENU -->
        <ul class="page-sidebar-menu " data-auto-scroll="true" data-slide-speed="200">
            <!-- DOC: To remove the sidebar toggler from the sidebar you just need to completely remove the below "sidebar-toggler-wrapper" LI element -->
            <li class="sidebar-toggler-wrapper">
                <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                <div class="sidebar-toggler">
                </div>
                <!-- END SIDEBAR TOGGLER BUTTON -->
            </li>
            <!-- BEGIN RESPONSIVE QUICK SEARCH FORM -->
            @*<form class="sidebar-search">
                    <div class="input-box">
                        <a href="javascript:;" class="remove"></a>
                        <input type="text" placeholder="Search..." />
                        <input type="button" class="submit" value=" " />
                    </div>
                </form>*@
            <!-- END RESPONSIVE QUICK SEARCH FORM -->
            @if( null != Model)
            {
                foreach (var node in Model)
            {
                <li class="@(node.IsActive?"active":"")">
                    <a href="@(string.IsNullOrEmpty(node.Url) ? "javascript:;" : node.Url)">
                        @if (!string.IsNullOrEmpty(node.IconClass))
                        {
                            <i class="@node.IconClass"></i>
                        }
                        <span class="title">@node.Text</span>
                        <span class="@(node.IsActive?"selected":"arrow ")"></span>
                    </a>
                    @if (node.Children.Count > 0)
                    {
                        <ul class="sub-menu">
                            @foreach (var item in node.Children)
                            {
                                <li class="@(item.IsActive ? "active" : "")">
                                    <a href="@item.Url">
                                        @if (!string.IsNullOrEmpty(item.IconClass))
                                        {
                                            <i class="icon-home"></i>
                                        }
                                        @item.Text
                                    </a>
                                </li>
                            }
                        </ul>
                    }
                </li>
            }
            }

        </ul>

        <!-- END SIDEBAR MENU -->
        <script type="text/javascript">
            function clickMenu(id) {
                localStorage.removeItem("startMenu");
                localStorage.setItem("startMenu", id);
                if (id == "home") {
                    $("#ulmenu li").removeClass("start active ");
                    $("#ulmenu li a span").get(1).className = "arrow";
                    $("#home").addClass("start active ");
                    $("#home a span").get(1).className = "selected";
                }
                else {
                    $("#home").removeClass("start active ");
                    $("#" + id).addClass("start active ");
                    $("#" + id + " a span").get(1).className = "selected";
                }
            }
        </script>
    </div>
</div>
